package threadDemo;



public class Test1  {

    public static void main(String[] args) {
        ThreadDemo t1 = new ThreadDemo("钢铁侠");
        ThreadDemo t2 = new ThreadDemo("美队");
        t1.start();
        t2.start();
    }
}
class ThreadDemo extends Thread{
    public ThreadDemo() {}
    public ThreadDemo(String name) {
        super(name);
    }

    @Override
    public void run() {
        //2、默认实现是super.run();
        for (int i = 0; i < 100; i++) {
            System.out.println(getName()+i);
        }
    }
}